package config;

public class Test
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		Test test = new Test();
		test.oneHand(3, 6, 3, 100);
	}
	public void oneHand(int pre, int x, int pos, int max)
	{
		int temp;
		for(int i = pos; i < max; i++)
		{
			temp = x;
			x = (x*pre)%10;
			System.out.println(pre+" " +x+" "+(i+1));
			pre = temp;
		}
	}
}
